﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Apps.Model.Base
{
    /// <summary>
    /// 系统基础字段
    /// </summary>

    public class SysBase
    {
        /// <summary>
        /// 创建人
        /// </summary>
        [Required(ErrorMessage = "创建人字段是必需的")]
        [StringLength(40, ErrorMessage = "创建人字段的最大长度为 40 个字符")]
        [Display(Name = "创建人")]
        public string CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新人
        /// </summary>
        [Display(Name = "更新人")]
        public string UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        //[JsonIgnore]
        [Display(Name = "更新时间")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500, ErrorMessage = "备注字段的最大长度为 500 个字符")]
        public string Remark { get; set; }
    }
}
